<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * Poster控制器
 */
class Poster extends AdminBase
{
    
    /**
     * Poster列表
     */
    public function PosterList()
    {
        
        $where = $this->logicPoster->getWhere($this->param);
        
        $this->assign('list', $this->logicPoster->getPosterList($where, 'a.*', 'a.id desc'));
        
        return $this->fetch('poster_list');
    }
    
    /**
     * Poster添加
     */
    public function PosterAdd()
    {
        
        $this->PosterCommon();
        
        return $this->fetch('poster_edit');
    }
    
    /**
     * Poster编辑
     */
    public function PosterEdit()
    {
        
        $this->PosterCommon();
        $info = $this->logicPoster->getPosterInfo(['a.id' => $this->param['id']], 'a.*');

        
        $this->assign('info', $info);
        
        return $this->fetch('poster_edit');
    }
    
    /**
     * Poster添加与编辑通用方法
     */
    public function PosterCommon()
    {
        
        IS_POST && $this->jump($this->logicPoster->PosterEdit($this->param));

    }
    


    
    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('PosterPicture', $this->param));
    }
}
